import React, { Component, createRef } from 'react'
import "./CreatRef.css"


export default class CreatRef extends Component {
    input = React.createRef()
    box = createRef()
    fn = ()=>{
     
        let value = this.input.current.value
        this.box.current.innerHTML=value
      
    
    }
  
    render() {
       
        return (
            <div>     
                <input onChange={this.fn} ref={this.input} type="text" name="" id="" className='in' />
                <button className='button' >点我提交吧</button>
                <div ref={this.box} className='box'></div>
                </div>
        )
    }
}
